ELF unexec: Don't insert a new section
authorAlan Modra <amodra@gmail.com>
Sun, 8 Nov 2015 17:29:00 +0000 (09:29 -0800)
committerRob Browning <rlb@defaultvalue.org>
Mon, 18 Jan 2016 21:18:18 +0000 (15:18 -0600)
commitee3beb72e75cdffa08b99e2f9d4829665feccb18
tree396dd769b06bd7be740f6cc3444dc1605442907f
parent75dc7e12d73ad8c1bf9583515e41913980883dbe
ELF unexec: Don't insert a new section

Emacs should build on ppc64el.  A problem with the bss has been fixed.

This upstream patch has been added [8/10]:

  ELF unexec: Don't insert a new section

  Reuse the .bss section instead, making it SHT_PROGBITS.  This way we
  don't need to mess with symbol st_shndx, or section sh_link and
  sh_info.

  This does lead to eu-elflint complaints about symbols defined in .bss
  with a needed version, because normally it is undefined symbols that
  have needed versions;  Defined symbols have version definitions.
  The exception is symbols defined by the linker in .dynbss for
  variables copied from a shared library in order to avoid text
  relocations, with copy relocs to copy their initial values from the
  shared library.  These symbols are both defined and have needed
  versions, and eu-elflink only expects to see them in SHT_NOBITS
  sections.  Of course there is no real problem with having such symbols
  in SHT_PROGBITS sections.  glibc ld.so handles them fine.

  * unexelf.c: Delete outdated comments.
  (PATCH_INDEX): Delete.
  (find_section): Delete.
  (unexec): Don't add a new section.  Instead reuse the last bss
  section, extending it to cover dumped data.  Make bss sections
  SHT_PROGBITS.  Remove all patching of sh_link, sh_info and
  st_shndx.  Rename bss sections.

Origin: upstream, commit: 3008c521740c5ad46a4eaf343b438b02c25e4de5
Bug: http://debbugs.gnu.org/20614
Bug-Debian: http://bugs.debian.org/808347
Added-by: Rob Browning <rlb@defaultvalue.org>
src/unexelf.c